package cn.admin.configcenter;


import cn.admin.configcenter.address.AddressServerIpHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class ConfigCenterApplication {

	private static Logger LOG = LoggerFactory.getLogger(ConfigCenterApplication.class);

	public static void main(String[] args) {
		ConfigurableApplicationContext applicationContext =
				SpringApplication.run(ConfigCenterApplication.class,args);
		String ip = AddressServerIpHolder.getAddressServerIp();
		String port = applicationContext.getEnvironment().getProperty("server.port");
		LOG.info("Config-Center has been started successfully.");
		LOG.info("Now, you can open the follow url to view config and service.");
		LOG.info("=========================[http://" + ip + ":" + port +
				"]=========================");
	}

}
